<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>买家订单列表</title>

</head>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Dashboard Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link href="asserts/css/bootstrap.min.css" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
        table {
            width: 100%;
            height: 100%;
            border: 1px solid green;
            margin: auto;
            margin-top: 50px;
        }
    </style>
</head>
<body bgcolor="#C7C7E2">
<div class="container-fluid">
    <a th:href="@{/lmh(username=${orderlist.get(0).getBuyerName()})}"> 返回主界面</a>
    <div class="row">
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <!--                    <form action="/buyer" method="post">-->
                    <!--                        按买家姓名查找订单：<input name="buyerName" type="text"/><input type="submit" value="确定"><br>-->
                    <!--                        歌手:<input name="singername" type="text"/><input type="submit" value="确定"><br>-->
                    </form>
                    <div>
                        <tr>
                            <th>订单id</th>
                            <th>姓名</th>
                            <th>手机号</th>
                            <th>金额</th>
                            <th>订单状态</th>
                            <th>支付状态</th>
                            <th>创建时间</th>
                        </tr>
                    </div>
                    <div>
                        <tr th:each="emp:${orderlist}">
                            <td th:text="${emp.getOrderId()}"></td>
                            <td th:text="${emp.getBuyerName()}"></td>
                            <td th:text="${emp.getBuyerPhone()}"></td>
                            <td th:text="${emp.getOrderAmount()}"></td>
                            <td th:switch="${emp.getOrderStatus()}">
                                <p th:case="0">新订单</p>
                                <p th:case="1">完结</p>
                                <p th:case="2">已取消</p>
                            </td>
                            <td th:switch="${emp.getPayStatus()}">
                                <p th:case="0">等待支付</p>
                                <p th:case="1">支付成功</p>
                            </td>
                            <td th:text="${#dates.format(emp.getCreateTime(), 'yyyy-MM-dd HH:mm')}"></td>
                            <td>
                                <a class="btn btn-sm btn-primary" th:href="@{/cancel(id=${emp.getOrderId()})}">取消订单</a>
                                <a class="btn btn-sm btn-primary" th:href="@{/paid(id=${emp.getOrderId()})}" >订单支付</a>
                                <a class="btn btn-sm btn-primary" th:href="@{/delete(id=${emp.getOrderId()})}" >删除订单</a>
                                <a class="btn btn-sm btn-primary" th:href="@{/detail(id=${emp.getOrderId()})}" >订单详情</a>

                            </td>
                        </tr>
                    </div>
                </table>
            </div>
        </main>
    </div>
</div>
</body>
</html>